package itheima.CatAndDog3;

public class AnimalDemo {

    public static void main(String[] args) {
        //创建对象，调用方法
        Jumpping j = new Cat();
        j.jump();
        System.out.println("-------------------");

        Animal a = new Cat();
        a.setName("布偶");
        a.setAge(5);
        System.out.println(a.getName() + "----" + a.getAge());
        a.eat();
        ((Cat) a).jump();


        a = new Cat("加菲",5);
        System.out.println(a.getName() + "----" + a.getAge());
        a.eat();
        System.out.println("-------------------");

        Cat c = new Cat();
        c.setName("折耳");
        c.setAge(4);
        System.out.println(a.getName() + "----" + a.getAge());
        c.eat();
        c.jump();
        System.out.println("-------------------");

        Animal b = new Dog("金毛",7);
        System.out.println(b.getName() + "----" + b.getAge());
        b.eat();
        ((Dog) b).jump();
    }
}
